﻿using System;
using System.Runtime.InteropServices;
using System.Text;

namespace com.szmxsoft.yeming
{
	// Token: 0x02000016 RID: 22
	public class ReadCardUtil
	{
		// Token: 0x06000027 RID: 39
		[DllImport("sdtapi.dll", CharSet = CharSet.Ansi)]
		public static extern int InitComm(int iPort);

		// Token: 0x06000028 RID: 40
		[DllImport("sdtapi.dll")]
		public static extern int CloseComm();

		// Token: 0x06000029 RID: 41
		[DllImport("sdtapi.dll")]
		public static extern int Authenticate();

		// Token: 0x0600002A RID: 42
		[DllImport("sdtapi.dll")]
		public static extern int Routon_IC_FindCard();

		// Token: 0x0600002B RID: 43
		[DllImport("sdtapi.dll")]
		public static extern int Routon_IC_HL_ReadCardSN(StringBuilder code);

		// Token: 0x0600002C RID: 44
		[DllImport("sdtapi.dll")]
		public static extern int Routon_BeepLED(bool BeepON, bool LEDON, int duration);

		// Token: 0x0600002D RID: 45
		[DllImport("sdtapi.dll")]
		public static extern int ReadBaseInfos(StringBuilder Name, StringBuilder Gender, StringBuilder Folk, StringBuilder BirthDay, StringBuilder Code, StringBuilder Address, StringBuilder Agency, StringBuilder ExpireStart, StringBuilder ExpireEnd);

		// Token: 0x0600002E RID: 46
		[DllImport("sdtapi.dll")]
		public static extern int ReadBaseInfosPhoto(StringBuilder Name, StringBuilder Gender, StringBuilder Folk, StringBuilder BirthDay, StringBuilder Code, StringBuilder Address, StringBuilder Agency, StringBuilder ExpireStart, StringBuilder ExpireEnd, StringBuilder directory);

		// Token: 0x0600002F RID: 47
		[DllImport("sdtapi.dll")]
		public static extern int Routon_IC_HL_ReadCard(int SID, int BID, int KeyType, ref long Key, [MarshalAs(UnmanagedType.LPArray)] byte[] data);

		// Token: 0x06000030 RID: 48
		[DllImport("Sdtapi.dll")]
		public static extern int ReadIINSNDN(StringBuilder cardnum);

		// Token: 0x06000031 RID: 49
		[DllImport("Sdtapi.dll")]
		public static extern int GetSAMIDToStr(StringBuilder cardID);

		// Token: 0x06000032 RID: 50 RVA: 0x00002761 File Offset: 0x00000961
		public void closePort()
		{
			ReadCardUtil.CloseComm();
		}

		// Token: 0x06000033 RID: 51 RVA: 0x00002769 File Offset: 0x00000969
		public int openPort(int port)
		{
			return ReadCardUtil.InitComm(port);
		}

		// Token: 0x06000034 RID: 52 RVA: 0x00002771 File Offset: 0x00000971
		public int findIcCard()
		{
			return ReadCardUtil.Routon_IC_FindCard();
		}

		// Token: 0x06000035 RID: 53 RVA: 0x00002778 File Offset: 0x00000978
		public int readIcCartd(StringBuilder code)
		{
			return ReadCardUtil.Routon_IC_HL_ReadCardSN(code);
		}

		// Token: 0x06000036 RID: 54 RVA: 0x00002780 File Offset: 0x00000980
		public int openAuthenticate()
		{
			return ReadCardUtil.Authenticate();
		}

		// Token: 0x06000037 RID: 55 RVA: 0x00002788 File Offset: 0x00000988
		public int readMsg(StringBuilder Name, StringBuilder Gender, StringBuilder Folk, StringBuilder BirthDay, StringBuilder Code, StringBuilder Address, StringBuilder Agency, StringBuilder ExpireStart, StringBuilder ExpireEnd)
		{
			return ReadCardUtil.ReadBaseInfos(Name, Gender, Folk, BirthDay, Code, Address, Agency, ExpireStart, ExpireEnd);
		}

		// Token: 0x06000038 RID: 56 RVA: 0x000027AC File Offset: 0x000009AC
		public int readMsgPhoto(StringBuilder Name, StringBuilder Gender, StringBuilder Folk, StringBuilder BirthDay, StringBuilder Code, StringBuilder Address, StringBuilder Agency, StringBuilder ExpireStart, StringBuilder ExpireEnd, StringBuilder directory)
		{
			return ReadCardUtil.ReadBaseInfosPhoto(Name, Gender, Folk, BirthDay, Code, Address, Agency, ExpireStart, ExpireEnd, directory);
		}
	}
}
